﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel;

namespace KerriganDataContract.Vehicule
{
    [DataContract]
    public class VehicleDC : INotifyPropertyChanged
    {
        private int _IdVehicle;
        private string _Name;
        private DateTime _LastRevision;
        private TypeVehicleDC _TypeVehicle;
        
        [DataMember]
        public int IdVehicle
        {
            get { return this._IdVehicle; }
            set { this._IdVehicle = value; OnPropertyChanged("IdVehicle"); }
        }

        [DataMember]
        public string Name
        {
            get { return this._Name; }
            set { this._Name = value; OnPropertyChanged("Name"); }
        }

        [DataMember]
        public DateTime LastRevision
        {
            get { return this._LastRevision; }
            set { this._LastRevision = value; OnPropertyChanged("LastUsed"); }
        }

        [DataMember]
        public TypeVehicleDC TypeVehicle
        {
            get { return this._TypeVehicle; }
            set { this._TypeVehicle = value; OnPropertyChanged("TypeVehicle"); }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string property)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(property));
            }
        }
    }
}
